using System;
using System.Collections.Generic;
using NHibernate;
using Symbonix.NorSoNet.Security.DAL.Entities;
using Symbonix.Library.Data.NHibernate;
using System.Collections;
using NHibernate.Criterion;

namespace Symbonix.NorSoNet.Security.DAL.Repositories
{
	public partial class ProfileDataRepository : BaseRepository<ProfileData,Int32>
	{
        public ProfileData GetProfileDataByUserID(int UserID)
        {
            ICriteria criteria = GetCriteria();
            criteria.Add(Expression.Eq("UserID", UserID));
            IList result = criteria.List();
            if (result != null && result.Count > 0)
                return (ProfileData)result[0];
            else
                return null;
        }
	}
}
